.TH qalloc_malloc 3 "NOVEMBER 2006" libqthread "libqthread"
.SH NAME
.BR qalloc_malloc ,
.BR qalloc_statmalloc ,
.B qalloc_dynmalloc
\- allocates memory from the specified map
.SH SYNOPSIS
.B #include <qthread/qalloc.h>

.I void *
.br
.B qalloc_malloc
.RI "(void *" map ", size_t " size );
.PP
.I void *
.br
.B qalloc_statmalloc
.RI "(struct mapinfo_s *" map );
.PP
.I void *
.br
.B qalloc_dynmalloc
.RI "(struct dynmapinfo_s *" map ", size_t " size );
.SH DESCRIPTION
These are the allocation functions. They return a pointer to an allocated
memory block from the specified qalloc
.IR map .
The
.BR qalloc_statmalloc ()
function only needs a pointer to the
.I map
itself, as the size of the returned block is the same for all allocations from
that map.
.BR qalloc_dynmalloc ()
on the other hand also takes a
.I size
argument, since by definition, a dynamic map allows for any size allocation.
.BR qalloc_malloc ()
will use whichever of the other two functions is appropriate for the map it is
passed; however, if the map is a static map, the
.I size
argument is ignored.
.SH SEE ALSO
.BR qalloc_cleanup (3),
.BR qalloc_checkpoint (3),
.BR qalloc_free (3),
.BR qalloc_loadmap (3)
